package java6699.lesson06;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @program: java_zzx
 * @description: 读取配置文件
 * @author: zzx
 * @create: 2022-10-11 18:09
 **/
public class Profile6699 {
    public static void main(String[] args) {
        Properties properties = new Properties();//创建集合
        InputStream Stram = Profile6699.class.getResourceAsStream("myProFile6699.properties");
        try {
            properties.load(Stram);
            //输出学号
            System.out.println("学号："+properties.getProperty("id"));
            //输出姓名
            System.out.println("姓名："+properties.getProperty("name"));
            //输出性别
            System.out.println("性别："+properties.getProperty("sex"));
            //输出年龄
            System.out.println("年龄："+properties.getProperty("age"));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
